package com.weichen.xd.data;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

/**
 * Created by Dune on 2017/9/11.
 */

public class DailyForecast implements Parcelable {
    public static final Parcelable.Creator<DailyForecast> CREATOR = new Parcelable.Creator<DailyForecast>() {
        @Override
        public DailyForecast createFromParcel(Parcel source) {
            return new DailyForecast(source);
        }

        @Override
        public DailyForecast[] newArray(int size) {
            return new DailyForecast[size];
        }
    };
    /**
     * astro : {"mr":"03:09","ms":"17:06","sr":"05:28","ss":"18:29"}
     * cond : {"code_d":"100","code_n":"100","txt_d":"晴","txt_n":"晴"}
     * date : 2016-08-30
     * hum : 45
     * pcpn : 0.0
     * pop : 8
     * pres : 1005
     * tmp : {"max":"29","min":"22"}
     * vis : 10
     * wind : {"deg":"339","dir":"北风","sc":"4-5","spd":"24"}
     */

    @SerializedName("astro")
    private Astro astro;
    @SerializedName("cond")
    private Cond cond;
    @SerializedName("date")
    private String date;
    @SerializedName("hum")
    private String hum;
    @SerializedName("pcpn")
    private String pcpn;
    @SerializedName("pop")
    private String pop;
    @SerializedName("pres")
    private String pres;
    @SerializedName("tmp")
    private Tmp tmp;
    @SerializedName("vis")
    private String vis;
    @SerializedName("wind")
    private Wind wind;

    public DailyForecast() {
    }

    protected DailyForecast(Parcel in) {
        this.astro = in.readParcelable(Astro.class.getClassLoader());
        this.cond = in.readParcelable(Cond.class.getClassLoader());
        this.date = in.readString();
        this.hum = in.readString();
        this.pcpn = in.readString();
        this.pop = in.readString();
        this.pres = in.readString();
        this.tmp = in.readParcelable(Tmp.class.getClassLoader());
        this.vis = in.readString();
        this.wind = in.readParcelable(Wind.class.getClassLoader());
    }

    public Astro getAstro() {
        return astro;
    }

    public void setAstro(Astro astro) {
        this.astro = astro;
    }

    public Cond getCond() {
        return cond;
    }

    public void setCond(Cond cond) {
        this.cond = cond;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getHum() {
        return hum;
    }

    public void setHum(String hum) {
        this.hum = hum;
    }

    public String getPcpn() {
        return pcpn;
    }

    public void setPcpn(String pcpn) {
        this.pcpn = pcpn;
    }

    public String getPop() {
        return pop;
    }

    public void setPop(String pop) {
        this.pop = pop;
    }

    public String getPres() {
        return pres;
    }

    public void setPres(String pres) {
        this.pres = pres;
    }

    public Tmp getTmp() {
        return tmp;
    }

    public void setTmp(Tmp tmp) {
        this.tmp = tmp;
    }

    public String getVis() {
        return vis;
    }

    public void setVis(String vis) {
        this.vis = vis;
    }

    public Wind getWind() {
        return wind;
    }

    public void setWind(Wind wind) {
        this.wind = wind;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(this.astro, flags);
        dest.writeParcelable(this.cond, flags);
        dest.writeString(this.date);
        dest.writeString(this.hum);
        dest.writeString(this.pcpn);
        dest.writeString(this.pop);
        dest.writeString(this.pres);
        dest.writeParcelable(this.tmp, flags);
        dest.writeString(this.vis);
        dest.writeParcelable(this.wind, flags);
    }
}
